<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<div>
    <form:form servletRelativeAction="/member/moneyLogs" data-toggle="ajaxsearch" id="moneyLogForm" modelAttribute="moneyLogIndex">
        <form:hidden path="id"/>
        <form:hidden path="pageCurrent"/>
        <form:hidden path="pageSize"/>
    </form:form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table" >
        <thead>
        <tr>
            <th data-options="{name:'id'}">流水号</th>
            <th data-options="{name:'addTime'}">发生时间</th>
            <th data-options="{name:'type'}">类型</th>
            <th data-options="{name:'affectMoney'}">影响金额</th>
            <th data-options="{name:'accountMoney'}">可用金额</th>
            <th data-options="{name:'freezeMoney'}">冻结金额</th>
            <th data-options="{name:'collectMoney'}">待收金额</th>
            <th data-options="{name:'info'}">信息</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${memberMoneyLogs.iterator()}" var="obj">
        <tr>
            <td>${obj.id}</td>
            <td>${obj.addTime}</td>
            <td>${obj.type}</td>
            <td><fmt:formatNumber value="${obj.affectMoney}" type="CURRENCY"/></td>
            <td><fmt:formatNumber value="${obj.accountMoney}" type="CURRENCY"/></td>
            <td><fmt:formatNumber value="${obj.freezeMoney}" type="CURRENCY"/></td>
            <td><fmt:formatNumber value="${obj.collectMoney}" type="CURRENCY"/></td>
            <td title="${obj.info}">${fn:substring(obj.info,0 ,20 )}<c:if test="${fn:length(obj.info) > 20}">...</c:if> </td>
        </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
    <div data-toggle="pagination" data-options="{total:${memberMoneyLogs.totalElements},form:'#moneyLogForm',pageCurrent:${moneyLogIndex.pageCurrent},callback:pagingCallback}"></div>
</div>
<script type="text/javascript">
    function pagingCallback(pageCurrent,pageSize){
        $("#pageCurrent").val(pageCurrent);
        $("#pageSize").val(pageSize);
        $("#moneyLogForm").submit();
    }
</script>